import re
#匹配一个ip
# 每一段ip的情况
# 只有1个数字：\d\b
# 只有2个数字:[1-9]\d\b
# 只有3个数字:1\d\d\b|2[0-4]\d|25[0-5]
print(re.match(r"((\d\b|[1-9]\d\b|1\d\d\b|2[0-4]\d|25[0-5])\.){3}(\d\b|[1-9]\d\b|1\d\d\b|2[0-4]\d|25[0-5])",
               "199.19.1.0"))